nlp_architect.common.cdc.mention_data.MentionData

class nlp_architect.common.cdc.mention_data.MentionData(topic_id: str, doc_id: str, sent_id: int, tokens_numbers: List[int], tokens_str: str, mention_context: List[str], mention_head: str, mention_head_lemma: str, coref_chain: str, mention_type: str = 'NA', is_continuous: bool = True, is_singleton: bool = False, score: float = -1.0, predicted_coref_chain: str = None, mention_pos: str = None, mention_ner: str = None, mention_index: int = -1)[source]
__init__(topic_id: str, doc_id: str, sent_id: int, tokens_numbers: List[int], tokens_str: str, mention_context: List[str], mention_head: str, mention_head_lemma: str, coref_chain: str, mention_type: str = 'NA', is_continuous: bool = True, is_singleton: bool = False, score: float = -1.0, predicted_coref_chain: str = None, mention_pos: str = None, mention_ner: str = None, mention_index: int = -1) → None[source]

Object represent a mention

Parameters
  • topic_id – str topic ID

  • doc_id – str document ID

  • sent_id – int sentence number

  • tokens_numbers – List[int] - tokens numbers

  • mention_context – List[str] - list of tokens strings

  • coref_chain – str

  • mention_type – str one of (HUM/NON/TIM/LOC/ACT/NEG)

  • is_continuous – bool

  • is_singleton – bool

  • score – float

  • predicted_coref_chain – str (should be field while evaluated)

  • mention_pos – str

  • mention_ner – str

  • mention_index – in case order is of value (default = -1)

Methods

__init__(topic_id, doc_id, sent_id, …)

Object represent a mention

gen_mention_id()

get_mention_id()

get_tokens()

read_json_mention_data_line(mention_line)

param mention_line

a Json representation of a single mention

read_mentions_json_to_mentions_data_list(…)

param mentions_json_file

the path of the mentions json file to read

static_gen_token_unique_id(doc_id, sent_id, …)

gen_mention_id() → str[source]
get_mention_id() → str[source]
get_tokens()[source]
static read_json_mention_data_line(mention_line: str)[source]
Parameters

mention_line – a Json representation of a single mention

Returns

MentionData object

static read_mentions_json_to_mentions_data_list(mentions_json_file: str)[source]
Parameters

mentions_json_file – the path of the mentions json file to read

Returns

List[MentionData]

static static_gen_token_unique_id(doc_id: int, sent_id: int, token_id: int) → str[source]